﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GiMessCommons;

namespace GiMessServer.Net
{
    public class NetMsg
    {
        private string header = "GMSG";     //4B
        private string version = "1000";    //8B
        private int service;                //12B
        private int pktLen;                 //16B
        private string data;

        #region Constructors
        public NetMsg(NetServices Service)
        {
            service = (int)Service;
            pktLen = 0;
            data = "";
        }

        public NetMsg(NetServices Service, string Data)
        {
            this.service = (int)Service;
            data = Data;
            pktLen = data.Length;
        }
        #endregion

        #region Properties

        public string Header
        {
            get { return header; }
            //set { header = value; }
        }

        public string Version
        {
            get { return version; }
            set { version = value; }
        }

        public int Service
        {
            get { return service; }
            set { service = value; }
        }

        public int Length
        {
            get { return pktLen; }
            //set { pktLen = value; }
        }

        public string Data
        {
            get { return data; }
            set { data = value; pktLen = data.Length; }
        }

        #endregion
    }
}
